/**
 * @author 徐楠
 * @date 2021/11/22 10:58
 * @version 1.0
 */

package edu.nuist.javaProjct.gwy;

import java.util.Arrays;

public class PCBD {

    public final int LENGTH = 10;

    //进程名
    public String processName;
    //优先级
    public int priority;
    //CPU运行时间
    public int CPURunningTime;
    //进程状态
    public String state;
    //阻塞时间
    public int blockingTime;
    //指令条数
    public int orders;
    //存储所有指令
    public int[] orderSet = new int[LENGTH];
    //检索指令数组用的索引
    public int processAddressArrayIndex;
    //指令条数
    public int ordersLOCK;


    public PCBD() {
        processAddressArrayIndex = 0;
        for (int i = 0; i < LENGTH; i++) {
            orderSet[i] = 0;
        }
        ordersLOCK = 0;
    }


    @Override
    public String toString() {
        return "PCBDao{" +
                "LENGTH=" + LENGTH +
                ", processName='" + processName + '\'' +
                ", priority=" + priority +
                ", CPURunningTime=" + CPURunningTime +
                ", state='" + state + '\'' +
                ", blockingTime=" + blockingTime +
                ", orders=" + orders +
                ", orderSet=" + Arrays.toString(orderSet) +
                ", processAddressArrayIndex=" + processAddressArrayIndex +
                ", ordersLOCK=" + ordersLOCK +
                '}';
    }
}
